##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 11\11.1487 - No Title.py
# Description: No Title
##############################################################################
import sqlite3
with sqlite3.connect("brazil.db") as connection:
connection.row_factory = sqlite3.Row
print(f"{'Id':3s} {'State': <20s} {'Population':12s}")
print("=" * 37)
for state in connection.execute("select * from states order by name"):
print(f"{state['id']:3d} {state['name'] :<20s} {state['population']:12d}")